﻿using Microsoft.AspNetCore.Mvc;
using studentSubsidy.Entity;
using studentSubsidy.Service;

namespace studentSubsidy.Controllers
{
    [ApiController]
    [Route("api/adminFinancial/[Action]")]
    public class AdminFinancialController: Controller
    {
        private AdminFinancialService _adminFinancialService = new AdminFinancialService();
        
        [HttpGet(Name = "getPaymentList")]
        public Result GetPaymentList([FromQuery] string role)
        {
            return _adminFinancialService.getPaymentList(role);
        }
        
        [HttpGet(Name = "getPaymentInfo")]
        public Result GetPaymentInfo([FromQuery] int applyId)
        {
            return _adminFinancialService.GetPaymentInfo(applyId);
        }
        
        [HttpPost(Name = "putPayment")]
        public Result PutPayment([FromQuery] int applyId)
        {
            return _adminFinancialService.putPayment(applyId);
        }
        
        [HttpGet(Name = "getHasPaymentList")]
        public Result GetHasPaymentList([FromQuery] string role)
        {
            return _adminFinancialService.getHasPaymentList(role);
        }
        
        [HttpGet(Name = "getRefundList")]
        public Result GetRefundList([FromQuery] string role)
        {
            return _adminFinancialService.getRefundList(role);
        }
        
        [HttpGet(Name = "getRefundData")]
        public Result GetRefundData([FromQuery] int applyId)
        {
            return _adminFinancialService.getRefundData(applyId);
        }
        
        [HttpGet(Name = "getRefundLog")]
        public Result GetRefundLog([FromQuery] int applyId)
        {
            return _adminFinancialService.getRefundLogList(applyId);
        }
        
        [HttpGet(Name = "getRefundInfo")]
        public Result GetRefundInfo([FromQuery] int applyId)
        {
            return _adminFinancialService.getRefundInfo(applyId);
        }
        
        [HttpPost(Name = "updateRefundState")]
        public Result UpdateRefundState([FromQuery] int applyId)
        {
            return _adminFinancialService.updateRefundState(applyId);
        }
        
        [HttpGet(Name = "getFinishProjectList")]
        public Result GetFinishProjectList([FromQuery] string role)
        {
            return _adminFinancialService.getFinishProjectList(role);
        }
        
    }
}